package com.prog3.calendarutec;




import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.*;

public class Mes extends Activity {

	Context context;
	
	
	 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mes);
        CalendarView cv = (CalendarView) findViewById(R.id.calendarView);
        View cb=cv.getChildAt(0);
        
       
        //cb.setBackgroundColor(android.graphics.Color.BLACK);
        
        context=this;
        cv.setOnDateChangeListener(new CalendarView.OnDateChangeListener() 
        {

			public void onSelectedDayChange(CalendarView view, int year,
					int month, int dayOfMonth) {
				// TODO Auto-generated method stub
				
				
				int[] calendario=new int[]{dayOfMonth,month,year};
				
				
				Intent i = new Intent(context, Dia.class);
				i.putExtra("fechas", calendario);
				context.startActivity(i);			
				//Toast.makeText(context,"--"+year+"/"+month+"/"+dayOfMonth,Toast.LENGTH_SHORT).show();
				  
				
			}
        	

			
        });
        
        CalendarView cc= (CalendarView) this.findViewById(R.id.calendarView);
        
       
   
    
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_mes, menu);
        return true;
    }
    
   
    
  
}
